package com.yuntuzhilian.chapter3.demo2;

/**
 * @author MrWang-shuizhishuiheshui
 * @description
 */
public class Test {
    public static void main(String[] args) {
        Penguin pg = new Penguin();
        //通过set方法将数据向属性中传递
        pg.setSex("雄");
        //通过get方法从属性中取出来
        System.out.println(pg.getSex());

        pg.setAge(2);
        System.out.println(pg.getAge());

//        pg.age=-2;
//        pg.show();
    }
}
